﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class AllUsers_register : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            panel_Registrace.Visible = true;
            panel_Potvrzeni.Visible = false;
        }
    }
    protected void cmd_Odeslat_Click(object sender, EventArgs e)
    {
        Person p = PersonManager.addNewUser(txt_email.Text, txt_heslo.Text, txt_jmeno.Text, txt_prijmeni.Text, txt_titul.Text, txt_ulice.Text,
            txt_mesto.Text, txt_psc.Text, txt_telefon.Text);

        if (p != null)
        {
            lbl_VysledekRegistrace.Text = "Registrace uživatele probehla úspěšně";
            lbl_VysledekRegistrace.ForeColor = System.Drawing.Color.Green;
        }
        else
        {
            lbl_VysledekRegistrace.Text = "Registrace uživatele se nezdařila";
            lbl_VysledekRegistrace.ForeColor = System.Drawing.Color.Red;
        }
        panel_Registrace.Visible = false;
        panel_Potvrzeni.Visible = true;
    }
    protected void cmd_Vymazat_Click(object sender, EventArgs e)
    {
        txt_email.Text = txt_heslo.Text = txt_heslo_potvrzeni.Text = txt_heslo.Text =  txt_jmeno.Text = txt_prijmeni.Text = 
            txt_psc.Text = txt_mesto.Text = txt_telefon.Text = txt_titul.Text = txt_ulice.Text = "";
    }
}
